//	CP2013 Traffic Simulator Assignment 2
//      Traffic Model Zone
//	Java version
//      Coded by Matthew Johnson

package Traffic;


//Stores an area that vehicles need to be aware of such as other vehicles,
//roads, the intersection and stop lines
public class Zone
{
    //The type of zone the instance is
    private ZoneType type;
    //The position and size of the zone
    private PositionArea area;

    //Constructor: Instantiates a new Zone object
    Zone(PositionArea pa, ZoneType type)
    {
        area = pa;
        this.type = type;
    }

    //Tests if 2 Zones are overlapping
    public boolean overlaps (Zone other)
    {
        return area.overlaps(other.area);
    }

    public boolean overlaps(PositionArea other)
    {
        return area.overlaps(other);
    }

    //Setter: Sets the type
    public void setState(ZoneType newState)
    {
        type = newState;
    }

    //Getter: Gets the type
    public ZoneType getState()
    {
        return type;
    }

    //Getter: Gets the area
    public PositionArea getArea()
    {
        return area;
    }
}
